home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / cshell23.arc / SHELL.DOC < prev    next >
Encoding:
Text File  |  1986-02-04  |  35.0 KB  |  924 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  68.  
  69.  
  70.           NAME              NAME  
  71.  
  72.                pc-shell - pc command processor 
  73.  
  74.           SYNOPSIS              SYNOPSIS  
  75.  
  76.                pc shell                                             pc-shell  [-s] [-v] [arg1 ... argn] 
  77.  
  78.           DESCRIPTION              DESCRIPTION  
  79.  
  80.                pc-shell is a command processor for IBM-PC's and compatibles that 
  81.                emulates  some  of  the  more desirable functions of the Berkeley
  82.                UNIX* C-shell. In addition, it implements PC-DOS versions of some 
  83.                of the common UNIX* commands - ls, mv, cp, etc.  
  84.  
  85.                     s                                                                             The -s option causes the program execute a file called "shell.rc" 
  86.                in the  current directory (if it exists) before  passing  control
  87.                to the user.  
  88.  
  89.                      v                                                                           The  -v  option (verbose) causes the program to echo all commands
  90.                to the standard error stream before executing them.  
  91.  
  92.                arg1     argn                                                                     arg1 ... argn (the command  line  arguments)  are  put  into  the
  93.                shell's environment as the variables $1 through $n.  
  94.  
  95.  
  96.           Wild Card Substitution              Wild Card Substitution  
  97.  
  98.                Ambiguous  file  names  are expanded to file lists on the command
  99.                line for  all  internal  commands.    This  can  be  defeated  by
  100.                quoting.  
  101.  
  102.                The file name expansion does not take place for external programs 
  103.                because  of  the  128  character  limit for the DOS command line.
  104.                Also, many programs do their own expansion,  to  circumvent  this
  105.                limit.  
  106.  
  107.  
  108.           History Substitution              History Substitution  
  109.  
  110.  
  111.                History substitution is a powerful means to save retyping of long 
  112.                command lines.It allows you to do things like re-execute the last 
  113.                command,  re-execute  the  last  command but redirect output to a
  114.                file, or execute a  new  command  with  arguments  from  previous
  115.                command  lines.    The  last  20  commands  are saved, and can be
  116.                reviewed by typing the 'history' command.  
  117.  
  118.                Previous commands can be referred to by their number, or relative 
  119.                to the  current  command's  number.    Parameters  from  previous
  120.                commands can be seperated out and used individually.  
  121.  
  122.                History  substitutions  specifications  come  in  two parts - the
  123.                command number  specifier and the argument  specifier,  seperated
  124.                by a  colon.    The  argument    specifier  is optional; if it is
  125.                omitted, the entire command line is specified.  
  126.  
  127.                <command specifier> ::= !! | !n | !-n 
  128.  
  129.  
  130.                                               -1-
  131.  
  132.  
  133.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  134.  
  135.  
  136.                !!  = last command
  137.                !n  = nth command
  138.                !-n = command n commands before current command number
  139.                !#  = the current command line
  140.  
  141.                <arg specifier> ::= :[^$*] | :n | :n* | <empty>
  142.                n   = number of argument (0 being the command name)
  143.                ^   = first argument (i.e. argv[1])
  144.                $   = last argument
  145.                *   = ^-$, or nothing if only one word on command line
  146.                n*  = arguments n through $
  147.  
  148.                <history subst specification> ::= <command specifier><arg specifier>
  149.  
  150.                This is not as complicatated as  it  may  appear.    Here  is  an
  151.                example session.  
  152.  
  153.                EXAMPLE 
  154.  
  155.                0% ls *.c
  156.                *.c
  157.                foo.c bar.c
  158.                1% more foo.c
  159.                /* edit the last argument of the last command */
  160.                2% edit !!:$            
  161.                /* go off and edit */
  162.                /* reference last argument of last command */
  163.                3% fgrep foo !!:$ bar.c 
  164.                FOO.C : foo
  165.                BAR.C : foo
  166.                /* edit the second thru the last args of command 3 */
  167.                4% edit !3:2*            
  168.                (go off and edit)
  169.                /* repeat last command */
  170.                %5 !!
  171.                (go off and edit)
  172.                /* remove the 1st argument of the command 2 before the current one */
  173.                %6 rm !-6:^
  174.  
  175.                History substitution here is a compatible subset of the [U|XE]NIX 
  176.                C shell    history  substitution  facility.    Cshell allows even
  177.                weirder combinations.  
  178.  
  179.  
  180.           Variable Substitution              Variable Substitution  
  181.  
  182.  
  183.                Shell variables are synonymous for our purposes with  environment
  184.                strings, i.e.  they are defined with the 'set' command.  
  185.  
  186.                Variables  are  referenced  on  the  command  line by prefacing a
  187.                variable name by a dollar sign.    Two  dollar  signs  in  a  row
  188.                signify a dollar sign character.  
  189.  
  190.                As  mentioned  above, command line arguments are contained in the
  191.                                                      n                                            shell variables, $1 through $n, where n is the number of the last 
  192.                argument.  
  193.  
  194.  
  195.  
  196.                                               -2-
  197.  
  198.  
  199.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  200.  
  201.  
  202.                EXAMPLE
  203.  
  204.                %0 set home = c:/
  205.                %1 echo $home
  206.                C:/
  207.                %2 ls $home
  208.                C:/*.*
  209.                command.com
  210.                %3 echo $path
  211.                C:/bin
  212.  
  213.                And so on.  
  214.  
  215.  
  216.           Special variables              Special variables  
  217.  
  218.                There are a some shell variables that have special  meanings  for
  219.                                                               set                                the shell.   They can be given values with the set command.  They
  220.                are 
  221.  
  222.               NOCLOBBER                  NOCLOBBER  
  223.  
  224.                       NOCLOBBER                                                                      If NOCLOBBER is equal to '1', then existing files may not  be
  225.                    destroyed  by  output  redirection,  and  output  files to be
  226.                    appended to by >> must exist.  
  227.  
  228.  
  229.               PROMPT                  PROMPT  
  230.  
  231.                        PROMPT                                                                        The PROMPT environment string is handled the same way  as  it
  232.                           COMMAND COM                                                                is by  COMMAND.COM.    There  is one pc-shell-specific prompt
  233.                    string character  !    that  specifies  the  current  command
  234.                    index.   If no PROMPT environment string is defined, then the
  235.                    default is '$!% '.  
  236.  
  237.  
  238.           Multiple commands on one command line              Multiple commands on one command line  
  239.  
  240.                Command lines are split at semicolons.  This can be  defeated  by
  241.                quoting or escaping.  
  242.  
  243.                EXAMPLE 
  244.  
  245.                %0 ls -l *.c ; make shell.exe ; exit
  246.  
  247.           Conditional command execution              Conditional command execution  
  248.  
  249.                If  two  commands  are seperated by '&&', then the second will be
  250.                executed only if the first returns 0 as an exit  code.    If  two
  251.                commands  are seperated by '||', then the second will be executed
  252.                only the first command returns non-zero as an exit code.  
  253.  
  254.                Example 
  255.  
  256.                    make shell.exe && chmod +w /bin/shell.exe && mv shell.exe /bin 
  257.  
  258.                    If the make operation fails, then the chmod and the  mv  will
  259.                    not be executed.  
  260.  
  261.  
  262.                                               -3-
  263.  
  264.  
  265.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  266.  
  267.  
  268.                    make shell.exe || echo You blew it bub!
  269.  
  270.                    If  the make operation fails, then the echo operation will be
  271.                    executed.  
  272.  
  273.  
  274.           Character Escapes  Shell Comments  and Argument Quoting              Character Escapes, Shell Comments, and Argument Quoting  
  275.  
  276.                Any character preceded by a  \ (backslash) is  copied  unmodified
  277.                to the  command  buffer.  This allows you to suppress the special
  278.                meanings of shell command characters, such as '|',  ';',  and  '*
  279.                '.  
  280.  
  281.                # is  the  shell comment character.  Anything on a line after a #
  282.                character is ignored.  
  283.  
  284.                String surrounded by single or double quotes are stripped of  the
  285.                quotes,  and  passed  without  wild-card expansion to the invoked
  286.                program.  
  287.  
  288.  
  289.           Startup and Script Files              Startup and Script Files  
  290.  
  291.  
  292.                If '-s' is specified on the command line the  program  will  look
  293.                for  a file called SHELL.RC in the current directory, and execute
  294.                it before passing  control to the console.  This  allows  you  to
  295.                set up  all  your alias commands.  It isn't a good idea to put an
  296.                'exit'  command  in  your  SHELL.RC  file,  as  the  shell   will
  297.                terminate.  
  298.  
  299.                                              sh                                                  Any file  whose extension is .sh is run as a command file.  There
  300.                                  sh                                                               is also a command sh, into which shell scripts whose extension is 
  301.                not .sh can be redirected as standard input.  
  302.  
  303.                EXAMPLE
  304.  
  305.                %0 sh <batch.fil        # use the sh command
  306.                %1 shell <batch.fil     # run the external program
  307.  
  308.  
  309.           INPUT OUTPUT              INPUT/OUTPUT  
  310.  
  311.                                                          COMMAND COM                             I/O redirection operates as it does under COMMAND.COM  with  some
  312.                additional options: 
  313.  
  314.             name              <name 
  315.  
  316.                               name                                          Opens the file name as the standard input.  
  317.  
  318.              word              <<word 
  319.  
  320.                                                                            word                  reads  the  shell  input up to a line which is identical to word.
  321.                The resulting text is put into an anonymous temporary file, which 
  322.                is given to the command as standard input.  
  323.  
  324.                 name                 >name
  325.                  name                 >!name
  326.  
  327.  
  328.                                               -4-
  329.  
  330.  
  331.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  332.  
  333.  
  334.                  name                 >&name
  335.                   name                 >&!name
  336.  
  337.                             name                                                                     The file name  is used as standard output.    If  it  doesn't
  338.                    exist,  it's  created; if it exists, it is truncated, and its
  339.                    previous contents are lost.  
  340.  
  341.                                    NOCLOBBER                                                         If the variable NOCLOBBER is set, the file must  not  already
  342.                    exist, or  an  error results.  The forms using an exclamation
  343.                    point override the NOCLOBBER variable's action.  
  344.  
  345.                               name                                                                   The form >&name routes standard  error  along  with  standard
  346.                              name                        output to name.  
  347.  
  348.                  name                 >>name
  349.                   name                 >>!name
  350.                   name                 >>&name
  351.                    name                 >>&!name
  352.  
  353.                                     name                                                             Uses  the  file  name  as standard output, like >, but places
  354.                                                                NOCLOBBER                              output at the end of file.  If the variable NOCLOBBER is set, 
  355.                    it is an error if the file doesn't already exist.  The  forms
  356.                    using  an exclamation point override the NOCLOBBER variable's
  357.                    action.  
  358.  
  359.  
  360.               BUILT IN COMMANDS                  BUILT-IN COMMANDS  
  361.  
  362.  
  363.                    Some of the internal commands are  UNIX*  style  replacements
  364.                    for  COMMAND.COM internal commands, and some are included for
  365.                    convenience.  
  366.  
  367.                        Output of the 'commands' command
  368.  
  369.                        a:              alias           b:              c:              
  370.                        cat             cd              chdir           chmod           
  371.                        cls             commands        copy            cp              
  372.                        d:              del             dir             dump            
  373.                        e:              echo            era             erase           
  374.                        error           exit            f:              fgrep           
  375.                        g:              h:              hd              history         
  376.                        i:              j:              ls              md              
  377.                        mkdir           more            mv              no history      
  378.                        popd            pushd           pwd             rd              
  379.                        rm              rmdir           set             sh              
  380.                        tee             touch           unalias         version         
  381.                        y               
  382.  
  383.                    There are many that are simply aliases, e.g.  'copy' and 'cp' 
  384.                    invoke the same program.  
  385.  
  386.  
  387.               COMMAND DESCRIPTION SYNTAX                  COMMAND DESCRIPTION SYNTAX  
  388.  
  389.                    terms used in syntax explanations :
  390.                    
  391.                    fname ::= PC-DOS ambiguous or unambiguous file or directory name.
  392.  
  393.  
  394.                                               -5-
  395.  
  396.  
  397.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  398.  
  399.  
  400.                    
  401.                    uname ::= unambiguous PC-DOS file or directory name
  402.                    
  403.                    string ::= any string of printable characters of arbitrary(<512) length.
  404.                    
  405.                    filelist ::= filename [filename .. filename]
  406.                    
  407.                    noargs ::= no arguments at all
  408.                    
  409.                    space ::= any white space characters
  410.                    
  411.                    {arg} ::= term is optional
  412.                    
  413.                    envstring ::=    <string>=<string> | <string><space>=<space><string> |
  414.                 <string><space><string>
  415.  
  416.  
  417.               COMMANDS                  COMMANDS  
  418.  
  419.  
  420.                    drive                     drive
  421.  
  422.                        a: | b: | c: | d: | e: | f: | g: | h: | i: | j: <noargs> 
  423.  
  424.                        changes default drive.  If you don't have such  a  drive,
  425.                        nothing happens.  
  426.  
  427.                    alias                     alias
  428.  
  429.                        alias <envstring> 
  430.  
  431.                        assigns cmdstring  to name.  name can now be used just as
  432.                        if it were a built-in or external command.  cmdstring may 
  433.                        contain history expressions or variable substitutions.  
  434.  
  435.                        The syntax of this command is flexible - you can  specify
  436.                        alii  (?)  in  the form 'name=subst','name subst','name =
  437.                        subst', or  'name  =subst.'  However  you  need  a  space
  438.                                   before                                                                 character  before  a  single quote in order to specify an
  439.                        alias that contains blanks.  
  440.  
  441.                            alias     set                                                                 The alias and set commands  are  case  sensitive,  unlike
  442.                                         COMMAND COM                            their analogs in COMMAND.COM.  
  443.  
  444.                    cat                     cat
  445.  
  446.                        cat {<filelist>} 
  447.  
  448.                        copies specified  files  to standard output.  If none are
  449.                        given, copies standard input to standard output 
  450.  
  451.                    cp                     cp
  452.  
  453.                        cp | copy <filelist> <uname> 
  454.  
  455.                        copies specified files to destination file or device.  If 
  456.                        more than one file is in the file list, <uname> must be a 
  457.                        directory.  
  458.  
  459.  
  460.                                               -6-
  461.  
  462.  
  463.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  464.  
  465.  
  466.                    cd                     cd
  467.  
  468.                        cd | chdir <dirname> 
  469.  
  470.                        makes <dirname> the current default directory.  
  471.  
  472.                    chmod                     chmod
  473.  
  474.                        chmod {-|+[rwh]*} <filelist> 
  475.  
  476.                        change file permissions for specified files 
  477.  
  478.                        +r, -r turn on or off read permission - i.e. hide the file.
  479.                        +w, -w turn on or off write permission.
  480.                        +h, -h turn on or off hidden attribute - converse of r
  481.                        +a, -a turn on or off archive attribute
  482.  
  483.                        Note that '-r'  or  '+rwh'  are  both  valid  syntax  for
  484.                        switches.   Also  new permission switches are permissable
  485.                        between file names with the following  warning:  I  don't
  486.                        reset the masks between file names - if you have a second 
  487.                        batch  of  attribute  changes  on  the  command line, the
  488.                        effect is additive.  If you're  not  careful,  you  could
  489.                        make a mess of a files attributes.  
  490.  
  491.                        If   you  don't  specify  any  attribute  switches,  file
  492.                        attributes will be set to 0, which  means  read,write,not
  493.                        hidden,not system, not  modified since last backup.  
  494.  
  495.                    cls                     cls
  496.  
  497.                        cls <noargs> 
  498.  
  499.                        clears the screen and homes the cursor.  
  500.  
  501.                    commands                     commands
  502.  
  503.                        commands <noargs> 
  504.  
  505.                        prints a  table  of  available  built-in  commands.  (see
  506.                        above) 
  507.  
  508.                    del                     del
  509.  
  510.                        del 
  511.  
  512.                        synonym for rm.  
  513.  
  514.                    dir                     dir
  515.  
  516.                        dir 
  517.  
  518.                        synonym for ls.  
  519.  
  520.                    dump                     dump
  521.  
  522.  
  523.                        dump filespec [block [page]] | [segment:[offset]] [count] 
  524.  
  525.  
  526.                                               -7-
  527.  
  528.  
  529.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  530.  
  531.  
  532.                        Where a block is 64K bytes and a page is 256 bytes
  533.                        Segment:offset are standard 8086 notation in hexadecimal
  534.                        Count is the number of bytes to dump in decimal
  535.  
  536.                        This came from some anonymous public domain source, ported by me
  537.  
  538.                    echo                     echo
  539.  
  540.                        echo <anything> 
  541.  
  542.                        echos argument list to screen.  
  543.  
  544.                    era                     era
  545.  
  546.                        era 
  547.  
  548.                        synonym for rm.  
  549.  
  550.                    error                     error
  551.  
  552.                        error <noargs> 
  553.  
  554.                        prints returned value of last command to the screen.  
  555.  
  556.                    exit                     exit
  557.  
  558.                        exit <noargs> 
  559.  
  560.                        terminates execution of the shell.  
  561.  
  562.                    fgrep                     fgrep
  563.  
  564.                        fgrep <pattern> <filelist> 
  565.  
  566.                        looks for unambiguous pattern  <pattern>  in  <filelist>.
  567.                        echos lines matching to the screen.  
  568.  
  569.                    history                     history
  570.  
  571.                        history <noargs> 
  572.  
  573.                        prints history list to standard output.  
  574.  
  575.                    ls                     ls
  576.  
  577.                        ls | dir {-[alqctrR]} <filelist> 
  578.  
  579.                        Lists files that match <filelist> 
  580.  
  581.                        -a all files, including system files are listed.  '.' and 
  582.                        '..'  are  suppressed,  but you know they're there if you
  583.                        need them, don't you?  
  584.                        -l prints out file times, permissions, etc 
  585.                        -q suppresses header line from display - useful when  you
  586.                        want to pipe stuff into another program.  
  587.                        -c print as one column.  
  588.                        -t sort by time, most recent last 
  589.                        -R recurse through all encountered subdirectories.  
  590.  
  591.  
  592.                                               -8-
  593.  
  594.  
  595.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  596.  
  597.  
  598.                        -r reverses sort order.  
  599.  
  600.                    md                     md
  601.  
  602.                        md | mkdir <uname> 
  603.  
  604.                        make a directory.  Prints an error if it can't be done 
  605.  
  606.                    more                     more
  607.  
  608.                        more {-[0-9]*} {<filelist>} 
  609.  
  610.                        List file to screen with pauses 
  611.  
  612.                        -n  specify  tab width when expanding tabs, where n is an
  613.                        integer.  more acts like 'cat' when redirected - you  can
  614.                        concatenate files  in  this  manner.    If  no  files are
  615.                        specifed, standard input is 'mored.' 
  616.  
  617.                    mv                     mv
  618.  
  619.                        mv <filelist> <uname> 
  620.  
  621.                        moves specified file  or  files  to  target  specifed  by
  622.                        <uname>.  If there is more than one file in list, <uname> 
  623.                        must be a directory 
  624.  
  625.                    popd                     popd
  626.  
  627.                        popd <noargs> 
  628.  
  629.                        returns to directory at top of directory stack.  
  630.  
  631.                    pushd                     pushd
  632.  
  633.                        pushd <uname> 
  634.  
  635.                        save  current  working  directory on directory stack, and
  636.                        changes current working directory to <uname>.  
  637.  
  638.                    pwd                     pwd
  639.  
  640.                        pwd 
  641.  
  642.                        prints current working directory to standard output.  
  643.  
  644.                    rd                     rd
  645.  
  646.                        rd | rmdir <uname> 
  647.  
  648.                        remove specified directory if possible.  
  649.  
  650.                    rm                     rm
  651.  
  652.                        rm {-q} <filelist> 
  653.  
  654.                        blows away all files in <filelist>. If -q  is  specified,
  655.                        will ask if they should be removed.  
  656.  
  657.  
  658.                                               -9-
  659.  
  660.  
  661.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  662.  
  663.  
  664.                    set                     set
  665.  
  666.                        set {<envstring>} 
  667.  
  668.                        sets a string in the environment.  If you specify 'name=' 
  669.                        with  no  string  after,  it  will  remove  it  from  the
  670.                        environment.  If you don't specify a string,  set  prints
  671.                        out current environment.  
  672.  
  673.                        The  syntax of this command is flexible - you can specify
  674.                        set in the form 'set  name=subst','set  name  subst','set
  675.                        name  =  subst', or 'set name =subst.' However you need a
  676.                                        before                                                             space character before a single quote in order to specify 
  677.                        a substitution string that contains blanks.  
  678.  
  679.                    sh                     sh
  680.  
  681.                        sh { <arg1> .. <argn>} <scriptfile 
  682.  
  683.                        forks a  'local'  shell  -  i.e.    saves  all  pertinent
  684.                        information  about  the  shell  you're  currently  in and
  685.                        invokes the command processor function recursively,  with
  686.                        scriptfile                                                                        scriptfile as  input.    The  arguments  are copied to $1
  687.                        through $N environment strings, overwriting  the  startup
  688.                        arguments.  
  689.  
  690.                        sh                                                                                sh  gives  you  a  way to run scripts, without loading an
  691.                        extra copy of shell.com or small.com.  
  692.  
  693.                    tee                     tee
  694.  
  695.                        tee <uname> 
  696.  
  697.                        Copies standard input to standard  output,  depositing  a
  698.                        copy in <uname> 
  699.  
  700.                    touch                     touch
  701.  
  702.                        touch <filelist> 
  703.  
  704.                        Makes  the  modification  time  of  specified  files  the
  705.                        current date and time.  
  706.  
  707.                    unalias                     unalias
  708.  
  709.                        unalias aliasname 
  710.  
  711.                        remove alias name from the alias list.  
  712.  
  713.                    y                     y
  714.  
  715.                        y <filelist> 
  716.  
  717.                        copies standard input to standard output, and then copies 
  718.                        the specified files to standard  output.    Sort  of  the
  719.                        opposite of tee, in other words.  
  720.  
  721.  
  722.  
  723.  
  724.                                              -10-
  725.  
  726.  
  727.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  728.  
  729.  
  730.               The Small Shell                  The Small Shell  
  731.  
  732.  
  733.                    Included  in release 2.0 or later is a 'small' version of the
  734.                    shell.   This version will take up less than 30K of memory at 
  735.                     runtime (as verified by chkdsk).  What's the catch?    Well,
  736.                    ls,  cp,  mv, more, fgrep, and dump become external commands.
  737.                    I am not going to distribute these commands; you  can  either
  738.                    make  them    yourself,  or  you can use whatever you have on
  739.                    hand.  If you need to use the COMMAND.COM copy facility,  try
  740.                    putting these commands in your SHELL.RC file 
  741.  
  742.                    alias cp 'command -c copy'
  743.                    alias ls 'command -c dir -w | sort'
  744.  
  745.                    The   removed   commands   accounted  for  over  10K  of  the
  746.                    shell.com.  
  747.  
  748.               Helpful hints                  Helpful hints  
  749.  
  750.  
  751.                    Use forward slashes in all path names.  (See  note  below  on
  752.                    switch  characters)    If  you  use  DOS  3.0 or higher, this
  753.                    includes paths to transient programs.  
  754.  
  755.                    put single quotes around arguments with semicolons  in  them,
  756.                    so they don't turn into command delimiters.  
  757.  
  758.                    The  set  command affects only the local shell's environment.
  759.                    You can 'exit' to command.com and the original environment is 
  760.                    intact.  The  local  environment  is  2K  large  -  which  is
  761.                    useful.  
  762.  
  763.                    When  using  the  Microsoft  C  compiler  under pc-shell, the
  764.                    compiler has a bad habit of  look  for  parameters  beginning
  765.                    with forward  slashes  in  the environment.  If you get their
  766.                    famous  'P0  :  bad  option'  message,   try   revising   the
  767.                    environment.  
  768.  
  769.  
  770.               Implementation notes                  Implementation notes  
  771.  
  772.  
  773.                    DOS  doesn't  acknowledge  a  'change  default drive' command
  774.                    until you issue a 'get current directory' call.   Why?    The
  775.                    only way I figured this out is by disassembling command.com.  
  776.  
  777.                    PC|MS-DOS has  a  limit  of  20  file  handles.  If you add a
  778.                    command that opens files, make sure you catch the  ctrl-break
  779.                    signal and close them.  Look at CAT.C or Y.C for examples.  
  780.  
  781.                    DON'T  REDIRECT  INPUT  INTO  PRINT. Print gets all hosed up.
  782.                    Print has lots of trouble in general with the  pc-shell,  and
  783.                    should be avoided.  
  784.  
  785.               BUGS                  BUGS  
  786.  
  787.  
  788.  
  789.  
  790.                                              -11-
  791.  
  792.  
  793.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  794.  
  795.  
  796.                    Due  to  the way that environment strings are expanded on the
  797.                    command line, semicolons inside  shell  variables  look  like
  798.                    command seperators.  This is not so much a bug as a gotcha.  
  799.  
  800.                    I  have  noticed intermittent problems running on an AT, with
  801.                    DOS 3.0, but have been unable to reproduce them on  a  PC.  I
  802.                    suspect bugs in DOS 3.0 that are absent in 3.1. If you notice 
  803.                    any consistent problems, send  me a bug report.  
  804.  
  805.                    DON'T  REDIRECT INPUT INTO PRINT. It gets mighty confused and
  806.                    goes into  an  endless  loop.      Don't   blame   me,   call
  807.                    MICROSOFT/IBM,  and  ask  them  where  the heck they look for
  808.                    their command line!!!  
  809.  
  810.               HISTORY                  HISTORY  
  811.  
  812.  
  813.  
  814.                   V 2 0                      V 2.0  
  815.  
  816.                        Minor bug fixes.  Started allocating command buffers  out
  817.                        of heap rather than stack, reducing stack usage.  Stopped 
  818.                        releasing source with executables.  
  819.  
  820.                   V 2 1                      V 2.1  
  821.  
  822.                        Fixed the bug that made "mv foo .." throw away the source 
  823.                        file and  move  it to "..foo", (i.e. nowhere).  Added the
  824.                        sh command,  that  allows  you  to  run  scripts  without
  825.                        re-invoking the shell.  
  826.  
  827.                   V 2 2                      V 2.2  
  828.  
  829.                        Fixed  the bug that locked pc up when a command line with
  830.                        a leading ; was entered.  Changed fork code so that files 
  831.                        with the extension .sh are run as scripts.    The  equals
  832.                        sign in alias and set is now optional.  
  833.  
  834.                   V 2 3                      V 2.3  
  835.  
  836.                        Removed  information  about versions 1.0 through 1.6 from
  837.                        documentation, adding any relevant material to  the  tips
  838.                        or implementation  notes sections.   Added redirection of
  839.                        standard error, and checking for  NOCLOBBER.  Implemented
  840.                        execution of the prompt string.  
  841.  
  842.                        The  switch  character  is now changed back to '/' before
  843.                        executing external  commands.    This  should  make  some
  844.                        Microsoft programs  happier.    The  environment with its
  845.                        forward slashes in the path are left intact.   We'll  see
  846.                        how that goes.  
  847.  
  848.                   DONATIONS REQUESTED                      DONATIONS REQUESTED  
  849.  
  850.  
  851.                        The shell seems to have generated an incredible amount of 
  852.                        interest, all around the country - someone apparently put 
  853.                        this code out over the usenet and arpanet, in addition to 
  854.  
  855.  
  856.                                              -12-
  857.  
  858.  
  859.                PC-SHELL (1)             PC-DOS C Shell              PC-SHELL (1)
  860.  
  861.  
  862.                        its original FIDOnet roots.  
  863.  
  864.                        I  would  like  to  keep  working  on  it,  but for it to
  865.                        progress further, it can  no  longer  be  a  'lunch  hour
  866.                        hack.' I am therefore requesting that those who feel that 
  867.                        this  is a useful piece of software send me a donation to
  868.                        further my efforts towards purchasing a machine for  home
  869.                        use.  
  870.  
  871.                        Anyone  sending  more  that 25$ will recieve: 1. a PC-DOS
  872.                        disk with most recent release full source and  executable
  873.                        image.  2. Source and executable for various other public 
  874.                        domain  *nix  programs  (tail,  nroff,  cut, paste, diff,
  875.                        grep) 
  876.  
  877.                        If you use this every day, or if you are giving  everyone
  878.                        in   your   place   of   employment   a  copy,  value  it
  879.                        accordingly.  
  880.  
  881.                        This does not constitute a  licensing  agreement  of  any
  882.                        sort, nor  is any warranty implied.  Once you have a copy
  883.                        of this program or its source,  it's  yours  to  hack  to
  884.                        pieces, use,  revere,  revile,  or  whatever.  I like the
  885.                        anarchic aspects of the various public domain networks.  
  886.  
  887.                        QUESTIONS COMMENTS BUGREPORTS GOTO 
  888.                        KENT WILLIAMS
  889.                        722 Rundell St.
  890.                        Iowa City, IA 52240
  891.                        (319) 338-6053 (HOME VOICE)
  892.                        
  893.                        * UNIX is an unregistered trademark of AT&T.
  894.  
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                                              -13-
  923.  
  924.